import {request} from '@umijs/max';

export async function fakeSubmitForm(params: any) {
  return request(`/product-server/api/v1/form_properties/${params.id?'update':'save'}`, {
    method: 'POST',
    data: params,
  });
}

export async function getFormOne(params: any) {
  return request('/product-server/api/v1/form_properties/find', {
    params,
  });
}


export async function addFormField(data: any) {
  return request('/product-server/api/v1/form_header/save', {
    data,
    method: 'post',
  });
}


export async function updateFormField(data: any) {
  return request('/product-server/api/v1/form_header/update', {
    data,
    method: 'post',
  });
}

export async function delFormField(data: any) {
  return request('/product-server/api/v1/form_header/del', {
    data,
    method: 'delete',
  });
}


export async function batUpdateFormField(data: any) {
  return request('/product-server/api/v1/form_header/batch_update_sort', {
    data,
    method: 'post',
  });
}